package com.fin.zw.intelligentbot.entity;

import com.fin.zw.intelligentbot.enums.MessageDataType;
import com.fin.zw.intelligentbot.enums.MessageMode;
import com.fin.zw.intelligentbot.enums.MessageReadStatus;
import com.fin.zw.intelligentbot.enums.MessageType;
import lombok.Data;
import org.hibernate.annotations.Table;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import java.util.Date;

@Entity
@Table(appliesTo = "web_socket_message", comment = "消息信息")
@Data
public class WebSocketMessage extends BaseEntity {

    @Column(columnDefinition = "varchar(100) COMMENT '消息接收人'")
    private String userName;

    @Enumerated(EnumType.STRING)
    @Column(columnDefinition = "varchar(50) COMMENT '消息数据类型'")
    private MessageDataType messageDataType = MessageDataType.Reminder;

    @Enumerated(EnumType.STRING)
    @Column(columnDefinition = "varchar(50) COMMENT '消息类型'")
    private MessageType messageType;

    @Column(columnDefinition = "varchar(100) COMMENT '消息标题'")
    private String title;

    @Column(columnDefinition = "date COMMENT '消息日期'")
    private Date msgDate;

    @Column(columnDefinition = "varchar(500) COMMENT '消息内容'")
    private String content;

    @Enumerated(EnumType.STRING)
    @Column(columnDefinition = "varchar(50) COMMENT '消息标识'")
    private MessageReadStatus readStatus = MessageReadStatus.UNREAD;

    @Enumerated(EnumType.STRING)
    @Column(columnDefinition = "varchar(50) COMMENT '消息模式'")
    private MessageMode messageMode = MessageMode.COMMON;
}
